package com.hyt.it.ogt.ykcj.service.exam.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hyt.core.base.BaseServiceImpl;
import com.hyt.it.ogt.ykcj.domain.exam.ExamResultDataDownLoadRecord;
import com.hyt.it.ogt.ykcj.mapper.exam.ExamResultDataDownLoadRecordMapper;
import com.hyt.it.ogt.ykcj.service.exam.IExamResultDataDownLoadRecordService;

/**
 */
@Service
public class ExamResultDataDownLoadRecordServiceImpl extends BaseServiceImpl<ExamResultDataDownLoadRecordMapper, ExamResultDataDownLoadRecord> implements IExamResultDataDownLoadRecordService {

	@Autowired
	private ExamResultDataDownLoadRecordMapper examResultDataDownLoadRecordMapper;

	@Override
	public ExamResultDataDownLoadRecord getExamResultDataDownLoadRecord(String examId, String officeId, String fileType) throws Exception {
		return examResultDataDownLoadRecordMapper.getLastOneByProjectAndFileType(examId, officeId, fileType);
	}

	@Override
	public Integer getExamResultDataDownLoadRecordTimes(String examId, String officeId, String fileType) throws Exception {
		return examResultDataDownLoadRecordMapper.getLastOneByProjectAndFileTypeTimes(examId, officeId, fileType);
	}

	@Override
	public List<ExamResultDataDownLoadRecord> getIsRunningDownloadZip(Set<String> examIds, String type) {
		List<String> examIdList = new ArrayList<String>(examIds);
		return examResultDataDownLoadRecordMapper.getIsRunningDownloadFileRecord(examIdList, type);
	}

	
}
